/// 视频剧集
class VideoSeq {
  final String title;
  final String url;

  const VideoSeq({ required this.url, required this.title });
}
// 视频信息模型
class VideoInfo {
  final String id;
  final String platform; // 来源平台
  String title;
  String? description;
  final String? category;
  final String? author;
  final Duration? duration;
  String? year;
  String? label;
  final double? rating;
  String? thumbnailUrl;
  String? videoUrl;
  String? detailUrl; // 视频详情页URL
  final Map<String, dynamic> extra;
  List<VideoSeq>? videoSeqs;

  VideoInfo({
    required this.id,
    required this.platform,
    required this.title,
    this.description,
    this.category,
    this.author,
    this.duration,
    this.year,
    this.rating,
    this.thumbnailUrl,
    this.detailUrl,
    this.videoUrl,
    this.videoSeqs,
    this.label,
    this.extra = const {},
  });
  
  Map<String, dynamic> toMap() {
    return {
      'id': id,
      'platform': platform,
      'title': title,
      'description': description,
      'category': category,
      'author': author,
      'duration': duration?.inSeconds,
      'year': year,
      'rating': rating,
      'thumbnailUrl': thumbnailUrl,
      'detailUrl': detailUrl,
      'extra': extra,
    };
  }
}